import * as job from './job';
import * as user from './user';
import * as task from './task';
import * as alert from './alert';
import * as auditLog from './auditLog';
import * as alertGroup from './alertGroup';
import * as alertReceiver from './alertReceiver';
import challengeFile from './challengeFile';
import * as notificationSendLog from './notificationSendLog';
import * as wechat from './wechat';
import * as asset from './asset';
import * as whitelist from './whitelist';
import * as blacklist from './blacklist';
import * as news from './news';
import warnId from './warnId';
import * as sitePortrait from './sitePortrait';
import * as notification from './notification';
import dashboardReport from './dashboardReport';

export default [
	// #region job
	{
		path: '/api/v1/job-list',
		method: 'POST',
		config: job.findMany,
	},
	{
		path: '/api/v1/job-pagination',
		method: 'POST',
		config: job.pagination,
	},
	{
		path: '/api/v1/job-hostname-list',
		method: 'POST',
		config: job.findJobHostnameList,
	},
	{
		path: '/api/v1/job-aviliable-task-name',
		method: 'GET',
		config: job.jobAviliableTaskNameList,
	},
	{
		path: '/api/v1/job-count',
		method: 'POST',
		config: job.count,
	},
	{
		path: '/api/v1/job-download',
		method: 'GET',
		config: job.download,
	},
	{
		path: '/api/v1/job/{jobId}',
		method: 'GET',
		config: job.findById,
	},
	{
		path: '/api/v1/job/{jobId}',
		method: 'POST',
		config: job.updateById,
	},
	{
		path: '/api/v1/job/{jobId}',
		method: 'DELETE',
		config: job.removeById,
	},
	{
		path: '/api/v1/job/{jobId}/verification',
		method: 'POST',
		config: job.verification,
	},
	{
		path: '/api/v1/job',
		method: 'DELETE',
		config: job.removeMany,
	},
	{
		path: '/api/v1/job',
		method: 'POST',
		config: job.createMany,
	},
	{
		path: '/api/v1/job-aviliable-task',
		method: 'POST',
		config: job.createBatchTask,
	},
	{
		path: '/api/v1/job-count-task',
		method: 'POST',
		config: job.countTask,
	},
	// #endregion

	// #region task
	{
		path: '/api/v1/task',
		method: 'POST',
		config: task.manualTask,
	},
	{
		path: '/api/v1/task-list',
		method: 'POST',
		config: task.findMany,
	},
	{
		path: '/api/v1/task-pagination',
		method: 'POST',
		config: task.pagination,
	},
	{
		path: '/api/v1/task-count',
		method: 'POST',
		config: task.count,
	},
	{
		path: '/api/v1/task/{taskId}',
		method: 'GET',
		config: task.findById,
	},
	{
		path: '/api/v1/task/{taskId}',
		method: 'DELETE',
		config: task.removeById,
	},
	{
		path: '/api/v1/task',
		method: 'DELETE',
		config: task.removeMany,
	},
	{
		path: '/api/v1/task/{taskId}/mark-warn-resolved',
		method: 'POST',
		config: task.markTaskWarnResolved,
	},
	{
		path: '/api/v1/task/{taskId}/mark-warn-unresolved',
		method: 'POST',
		config: task.markTaskWarnUnresolved,
	},
	{
		path: '/api/v1/task/{taskId}/warn-resolve-state',
		method: 'POST',
		config: task.changeWarnResolveState,
	},
	{
		path: '/api/v1/task/{taskId}/ignore-warn',
		method: 'POST',
		config: task.ignoreTaskWarn,
	},
	{
		path: '/api/v1/task/{taskId}/unignore-warn',
		method: 'POST',
		config: task.unignoreTaskWarn,
	},
	{
		path: '/api/v1/task/{taskId}/stop',
		method: 'GET',
		config: task.stop,
	},
	{
		path: '/api/v1/task/{taskId}/retry',
		method: 'GET',
		config: task.retry,
	},
	{
		path: '/api/v1/monitor-task/{taskId}',
		method: 'POST',
		config: task.monitorTaskUpdate,
	},
	// #endregion
	{
		path: '/api/v1/alert-pagination',
		method: 'POST',
		config: alert.pagination,
	},
	{
		path: '/api/v1/ops-log-pagination',
		method: 'POST',
		config: auditLog.opsPagination,
	},
	{
		path: '/api/v1/login-log-pagination',
		method: 'POST',
		config: auditLog.loginPagination,
	},
	{
		path: '/api/v1/ops-log-download',
		method: 'GET',
		config: auditLog.opsDownload,
	},
	{
		path: '/api/v1/login-log-download',
		method: 'GET',
		config: auditLog.loginDownload,
	},
	{
		path: '/api/v1/log-download',
		method: 'GET',
		config: auditLog.logDownload,
	},
	// #region user
	{
		path: '/api/v1/user',
		method: 'GET',
		config: user.findMany,
	},
	{
		path: '/api/v1/user',
		method: 'POST',
		config: user.create,
	},
	{
		path: '/api/v1/user-pagination',
		method: 'POST',
		config: user.pagination,
	},
	{
		path: '/api/v1/user-count',
		method: 'POST',
		config: user.count,
	},
	{
		path: '/api/v1/user/{userId}',
		method: 'GET',
		config: user.findById,
	},
	{
		path: '/api/v1/user-download',
		method: 'GET',
		config: user.download,
	},
	{
		path: '/api/v1/user/{userId}/wechat',
		method: 'GET',
		config: wechat.bindCheck,
	},
	{
		path: '/api/v1/user/{userId}/wechat/qrcode',
		method: 'GET',
		config: wechat.qrcode,
	},
	{
		path: '/api/v1/user/{userId}/wechat',
		method: 'DELETE',
		config: wechat.unbind,
	},
	{
		path: '/api/v1/user/{userId}/mfa',
		method: 'DELETE',
		config: user.unbindMfa,
	},
	// #endregion
	// #region alert
	{
		path: '/api/v1/alert-group-pagination',
		method: 'POST',
		config: alertGroup.pagination,
	},
	{
		path: '/api/v1/alert-group',
		method: 'GET',
		config: alertGroup.findMany,
	},
	{
		path: '/api/v1/alert-group-count',
		method: 'POST',
		config: alertGroup.count,
	},
	{
		path: '/api/v1/alert-group',
		method: 'POST',
		config: alertGroup.createOne,
	},
	{
		path: '/api/v1/alert-group/{alertGroupId}',
		method: 'POST',
		config: alertGroup.updateById,
	},
	{
		path: '/api/v1/alert-group/{alertGroupId}',
		method: 'DELETE',
		config: alertGroup.removeById,
	},
	{
		path: '/api/v1/alert-group',
		method: 'DELETE',
		config: alertGroup.removeMany,
	},
	{
		path: '/api/v1/alert-receiver-pagination',
		method: 'POST',
		config: alertReceiver.pagination,
	},
	{
		path: '/api/v1/alert-receiver',
		method: 'GET',
		config: alertReceiver.findMany,
	},
	{
		path: '/api/v1/alert-receiver-count',
		method: 'POST',
		config: alertReceiver.count,
	},
	{
		path: '/api/v1/alert-receiver',
		method: 'POST',
		config: alertReceiver.createOne,
	},
	{
		path: '/api/v1/alert-receiver/{alertReceiverId}',
		method: 'POST',
		config: alertReceiver.updateById,
	},
	{
		path: '/api/v1/alert-receiver/{alertReceiverId}',
		method: 'DELETE',
		config: alertReceiver.removeById,
	},
	{
		path: '/api/v1/alert-receiver',
		method: 'DELETE',
		config: alertReceiver.removeMany,
	},
	// #endregion
	{
		path: '/api/v1/challenge-file/{jobId}',
		method: 'GET',
		config: challengeFile,
	},
	{
		path: '/api/v1/notification-send-log-pagination',
		method: 'POST',
		config: notificationSendLog.pagination,
	},
	{
		path: '/api/v1/notification-send-log-count',
		method: 'POST',
		config: notificationSendLog.count,
	},
	// #region asset
	{
		path: '/api/v1/asset-pagination',
		method: 'POST',
		config: asset.pagination,
	},
	{
		path: '/api/v1/asset-list',
		method: 'POST',
		config: asset.findMany,
	},
	{
		path: '/api/v1/asset-count',
		method: 'POST',
		config: asset.count,
	},
	{
		path: '/api/v1/asset/{assetId}',
		method: 'POST',
		config: asset.updateById,
	},
	{
		path: '/api/v1/asset/{assetId}',
		method: 'GET',
		config: asset.findById,
	},
	{
		path: '/api/v1/asset/{assetId}/manual-task',
		method: 'POST',
		config: asset.addManualAssetTask,
	},
	{
		path: '/api/v1/asset/{assetId}/subdomain',
		method: 'POST',
		config: asset.addSubdomain,
	},
	// #endregion

	// #region whitelist
	{
		path: '/api/v1/whitelist',
		method: 'POST',
		config: whitelist.createOne,
	},
	{
		path: '/api/v1/whitelist-pagination',
		method: 'POST',
		config: whitelist.pagination,
	},
	{
		path: '/api/v1/whitelist-count',
		method: 'POST',
		config: whitelist.count,
	},
	{
		path: '/api/v1/whitelist/{whitelistId}',
		method: 'GET',
		config: whitelist.findById,
	},
	{
		path: '/api/v1/whitelist/{whitelistId}',
		method: 'POST',
		config: whitelist.updateById,
	},
	{
		path: '/api/v1/whitelist/{whitelistId}',
		method: 'DELETE',
		config: whitelist.removeById,
	},
	{
		path: '/api/v1/whitelist',
		method: 'DELETE',
		config: whitelist.removeMany,
	},
	// #endregion

	// #region blacklist
	{
		path: '/api/v1/blacklist',
		method: 'POST',
		config: blacklist.createOne,
	},
	{
		path: '/api/v1/blacklist-pagination',
		method: 'POST',
		config: blacklist.pagination,
	},
	{
		path: '/api/v1/blacklist-count',
		method: 'POST',
		config: blacklist.count,
	},
	{
		path: '/api/v1/blacklist/{blacklistId}',
		method: 'GET',
		config: blacklist.findById,
	},
	{
		path: '/api/v1/blacklist/{blacklistId}',
		method: 'POST',
		config: blacklist.updateById,
	},
	{
		path: '/api/v1/blacklist/{blacklistId}',
		method: 'DELETE',
		config: blacklist.removeById,
	},
	{
		path: '/api/v1/blacklist',
		method: 'DELETE',
		config: blacklist.removeMany,
	},
	// #endregion

	// #region news
	{
		path: '/api/v1/news',
		method: 'GET',
		config: news.query,
	},
	{
		path: '/api/v1/news',
		method: 'POST',
		config: news.createOne,
	},
	{
		path: '/api/v1/news/{newsId}',
		method: 'DELETE',
		config: news.removeById,
	},
	{
		path: '/api/v1/news',
		method: 'DELETE',
		config: news.removeMany,
	},
	{
		path: '/api/v1/news-pagination',
		method: 'POST',
		config: news.pagination,
	},
	{
		path: '/api/v1/news/{newsId}',
		method: 'POST',
		config: news.updateById,
	},
	// endregion
	{
		path: '/api/v1/warnid',
		method: 'GET',
		config: warnId,
	},
	// #region site-portrait
	{
		path: '/api/v1/site-portrait-pagination',
		method: 'POST',
		config: sitePortrait.pagination,
	},
	{
		path: '/api/v1/site-portrait-history',
		method: 'POST',
		config: sitePortrait.historyPagination,
	},
	// #endregion
	// #region notification
	{
		path: '/api/v1/notification-pagination',
		method: 'POST',
		config: notification.pagination,
	},
	{
		path: '/api/v1/notification',
		method: 'POST',
		config: notification.createOne,
	},
	{
		path: '/api/v1/notification',
		method: 'DELETE',
		config: notification.removeMany,
	},
	// #endregion
	{
		method: 'GET',
		path: '/doc/{filename*}',
		options: { auth: false },
		handler: {
			directory: {
				path: './static/doc',
				listing: false,
				lookupCompressed: false,
			},
		},
	},
	{
		method: 'GET',
		path: '/api/v1/report/dashboard',
		config: dashboardReport,
	},
];
